package first.endtoend

class RationCard
{

    Date validity;
    static belongsTo = [family: Family, tag: Tag]
    Date dateCreated
    Date lastUpdated

    static constraints = {
        family(blank: true)
        tag(nullable: false)
    }

    static mapping = {
        tag cascade: "delete"
    }


    @Override
    public java.lang.String toString()
    {
        if (this.id == null)
        {
            return "ration card doesn't exist"

        } else
        {
            return "ration card exists"

        }
    }
}

